package my.guojian.jdbc.util;

import java.io.IOException;
import java.util.Properties;

import org.apache.commons.lang.StringUtils;

public class IPConfigUtil {

	private static final Properties pro = new Properties();

	static {
		try {
			pro.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("ipConfig.properties"));
			// pro = PropertiesLoaderUtils.loadProperties(new
			// EncodedResource(new ClassPathResource("ipConfig.properties"),
			// "UTF-8"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static String getProperty(String proName) {
		String proValue = pro.getProperty(proName);
		if (StringUtils.isBlank(proValue)) {
			return "";
		}
		return proValue.trim();
	}

	public static void main(String[] args) {
		System.out.println(IPConfigUtil.getProperty("ywbase.url"));
	}
}
